package com.example.validator.blankOrEmptyAllowed;

//import jakarta.validation.ConstraintValidator;
//import jakarta.validation.ConstraintValidatorContext;

import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

public class BlankAndEmptyValidator implements ConstraintValidator<BlankAndEmpty, String> {

    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        // 允许 null 或非空字符串（包括空字符串 ""）
        return value == null || value.isEmpty();
    }
}